#include <iostream>
#include <unistd.h>
#include <pthread.h>
using namespace std;

void* newthreadrun(void *args)
{
    while(true)
    {
        cout << "I am new thread" << endl;
        sleep(1);
    }
}

int main()
{
    pthread_t tid;
    pthread_create(&tid,nullptr,newthreadrun,nullptr);

    while(true)
    {
        cout << "I am main thread" << endl;
        sleep(1);
    }

    return 0;
}


